

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>velocity command &mdash; LIGGGHTS v3.X documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="LIGGGHTS v3.X documentation" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="Manual.html" class="icon icon-home"> LIGGGHTS
          

          
          </a>

          
            
            
              <div class="version">
                v3.X
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_input_script.html">3. Input Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">4. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_gran_models.html">5. Contact models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_mesh_modules.html">6. Mesh modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">7. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">8. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">9. Modifying &amp; extending LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">10. Python interface to LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">11. Errors</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="Manual.html">LIGGGHTS</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="Manual.html">Docs</a> &raquo;</li>
        
      <li>velocity command</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/velocity.txt" rel="nofollow"> View page source</a>
          
          <a href="http://www.cfdem.com"> Website</a>
          
            <a href="Section_commands.html#comm" rel="nofollow"> Commands</a>
            
          
        
      </li>
    
  </ul>

  
  <hr/>
  
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="velocity-command">
<span id="index-0"></span><h1>velocity command<a class="headerlink" href="#velocity-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>velocity group-ID style args keyword value ...
</pre></div>
</div>
<ul class="simple">
<li>group-ID = ID of group of atoms whose velocity will be changed</li>
<li>style = <em>set</em> or <em>ramp</em> or <em>zero</em></li>
</ul>
<pre class="literal-block">
<em>set</em> args = vx vy vz
  vx,vy,vz = velocity value or NULL (velocity units)
  any of vx,vy,vz van be a variable (see below)
<em>setAngular</em> args = angularmx angularmy angularmz
  angularmx,angularmy,angularmz = angular momentum value or NULL (angular mometum units)
  any of angularmx,angularmy,angularmz van be a variable (see below)
<em>ramp</em> args = vdim vlo vhi dim clo chi
  vdim = <em>vx</em> or <em>vy</em> or <em>vz</em>
  vlo,vhi = lower and upper velocity value (velocity units)
  dim = <em>x</em> or <em>y</em> or <em>z</em>
  clo,chi = lower and upper coordinate bound (distance units)
<em>zero</em> arg = <em>linear</em> or <em>angular</em>
  <em>linear</em> = zero the linear momentum
  <em>angular</em> = zero the angular momentum
</pre>
<ul class="simple">
<li>zero or more keyword/value pairs may be appended</li>
<li>keyword = <em>dist</em> or <em>sum</em> or <em>mom</em> or <em>rot</em> or <em>loop</em> or <em>units</em></li>
</ul>
<pre class="literal-block">
<em>dist</em> value = <em>uniform</em> or <em>gaussian</em>
<em>sum</em> value = <em>no</em> or <em>yes</em>
<em>mom</em> value = <em>no</em> or <em>yes</em>
<em>rot</em> value = <em>no</em> or <em>yes</em>
<em>loop</em> value = <em>all</em> or <em>local</em> or <em>geom</em>
<em>rigid</em> value = fix-ID
  fix-ID = ID of rigid body fix
<em>units</em> value = <em>box</em> or <em>lattice</em>
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>velocity border set NULL 4.0 v_vz sum yes units box
velocity all zero linear
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Set or change the velocities of a group of atoms in one of several
styles.  For each style, there are required arguments and optional
keyword/value parameters.  Not all options are used by each style.
Each option has a default as listed below.</p>
<p>The <em>set</em> style sets the velocities of all atoms in the group to the
specified values.  If any component is specified as NULL, then it is
not set.  Any of the vx,vy,vz velocity components can be specified as
an equal-style or atom-style <a class="reference internal" href="variable.html"><em>variable</em></a>.  If the value
is a variable, it should be specified as v_name, where name is the
variable name.  In this case, the variable will be evaluated, and its
value used to determine the velocity component.</p>
<p>The <em>setAngular</em> is simular to <em>set</em>, however, sets the angular
momentum.</p>
<p>Equal-style variables can specify formulas with various mathematical
functions, and include <a class="reference internal" href="thermo_style.html"><em>thermo_style</em></a> command
keywords for the simulation box parameters or other parameters.</p>
<p>Atom-style variables can specify the same formulas as equal-style
variables but can also include per-atom values, such as atom
coordinates.  Thus it is easy to specify a spatially-dependent
velocity field.</p>
<p>The <em>ramp</em> style makekes velocities ramped
uniformly from vlo to vhi are applied to dimension vx, or vy, or vz.
The value assigned to a particular atom depends on its relative
coordinate value (in dim) from clo to chi.  For the example above, an
atom with y-coordinate of 10 (1/4 of the way from 5 to 25), would be
assigned a x-velocity of 1.25 (1/4 of the way from 0.0 to 5.0).  Atoms
outside the coordinate bounds (less than 5 or greater than 25 in this
case), are assigned velocities equal to vlo or vhi (0.0 or 5.0 in this
case).</p>
<p>The <em>zero</em> style adjusts the velocities of the group of atoms so that
the aggregate linear or angular momentum is zero.  No other changes
are made to the velocities of the atoms.  If the <em>rigid</em> option is
specified (see below), then the zeroing is performed on individual
rigid bodies, as defined by the <a class="reference internal" href="fix_rigid.html"><em>fix rigid or fix rigid/small</em></a> commands.  In other words, zero linear
will set the linear momentum of each rigid body to zero, and zero
angular will set the angular momentum of each rigid body to zero.
This is done by adjusting the velocities of the atoms in each rigid
body.</p>
<p>For all styles, no atoms are assigned z-component velocities if the
simulation is 2d; see the <a class="reference internal" href="dimension.html"><em>dimension</em></a> command.</p>
<hr class="docutils" />
<p>The keyword/value option pairs are used in the following ways by the
various styles.</p>
<p>The <em>sum</em> option is used by all styles, except <em>zero</em>.  The new
velocities will be added to the existing ones if sum = yes, or will
replace them if sum = no.</p>
<p>The <em>mom</em> and <em>rot</em> options are used by <em>create</em>.  If mom = yes, the
linear momentum of the newly created ensemble of velocities is zeroed;
if rot = yes, the angular momentum is zeroed.</p>
<hr class="docutils" />
<p>The <em>loop</em> option is used by <em>create</em> in the following ways.</p>
<p>If loop = all, then each processor loops over all atoms in the
simulation to create velocities, but only stores velocities for atoms
it owns.  This can be a slow loop for a large simulation.  If atoms
were read from a data file, the velocity assigned to a particular atom
will be the same, independent of how many processors are being used.
This will not be the case if atoms were created using the
<a class="reference internal" href="create_atoms.html"><em>create_atoms</em></a> command, since atom IDs will likely
be assigned to atoms differently.</p>
<p>If loop = local, then each processor loops over only its atoms to
produce velocities.  The random number seed is adjusted to give a
different set of velocities on each processor.  This is a fast loop,
but the velocity assigned to a particular atom will depend on which
processor owns it.  Thus the results will always be different when a
simulation is run on a different number of processors.</p>
<p>If loop = geom, then each processor loops over only its atoms.  For
each atom a unique random number seed is created, based on the atom&#8217;s
xyz coordinates.  A velocity is generated using that seed.  This is a
fast loop and the velocity assigned to a particular atom will be the
same, independent of how many processors are used.  However, the set
of generated velocities may be more correlated than if the <em>all</em> or
<em>local</em> options are used.</p>
<p>Note that the <em>loop geom</em> option will not necessarily assign identical
velocities for two simulations run on different machines.  This is
because the computations based on xyz coordinates are sensitive to
tiny differences in the double-precision value for a coordinate as
stored on a particular machine.</p>
<hr class="docutils" />
<p>The <em>rigid</em> option only has meaning when used with the <em>zero</em> style.
It allows specification of a fix-ID for one of the <a class="reference internal" href="fix_rigid.html"><em>rigid-body fix</em></a> variants which defines a set of rigid bodies.  The
zeroing of linear or angular momentum is then performed for each rigid
body defined by the fix, as described above.</p>
<p>The <em>units</em> option is used by <em>set</em>, <em>setAngular</em> and <em>ramp</em>.  If units = box,
the velocities and coordinates specified in the velocity command are
in the standard units described by the <a class="reference internal" href="units.html"><em>units</em></a> command
(e.g. Angstroms/fmsec for real units).  If units = lattice, velocities
are in units of lattice spacings per time (e.g. spacings/fmsec) and
coordinates are in lattice spacings.  The <a class="reference internal" href="lattice.html"><em>lattice</em></a>
command must have been previously used to define the lattice spacing.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div>none</div></blockquote>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><code class="xref doc docutils literal"><span class="pre">fix</span> <span class="pre">shake</span></code>, <a class="reference internal" href="lattice.html"><em>lattice</em></a></p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<dl class="docutils">
<dt>The option defaults are dist = uniform, sum = no, mom = yes, rot = no,</dt>
<dd>style on group-ID, loop = all, and units = box.  The</dd>
</dl>
<p>rigid option is not defined by default.</p>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2016, DCS Computing GmbH, JKU Linz and Sandia Corporation.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'v3.X',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: ''
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>